﻿Public Class FormHorizontalOffsetHistoryList
    Private Sub FormHorizontalOffsetHistoryList_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Dim objj As New clsProdSpec
        Dim dtable As DataTable = objj.selectSpecId()
        dtime.Text = DateTime.Now.ToShortDateString()
        Dim drspec As DataRow = dtable.NewRow()
        drspec("prod_spec_id") = "全部"
        dtable.Rows.InsertAt(drspec, 0)

        ComboBox1.DisplayMember = "prod_spec_id"
        ComboBox1.ValueMember = "prod_spec_id"
        ComboBox1.DataSource = dtable
        ComboBox1.SelectedIndex = 0
    End Sub

    Private Sub btnSearch_Click(sender As Object, e As EventArgs) Handles btnSearch.Click
        Dim obj As New clsSppyInfo
        Dim dt As DataTable = obj.selectAll(txt_prod_id1.Text.Trim(), txt_Name1.Text.Trim(), ComboBox1.Text, dtime.Text.Trim())
        dgv1.AutoGenerateColumns = False
        dgv1.DataSource = dt
    End Sub

    Private Sub dgv1_CellDoubleClick(sender As Object, e As DataGridViewCellEventArgs) Handles dgv1.CellDoubleClick
        Dim frmdetail As New FormHorizontalOffset
        If e.RowIndex > -1 And e.ColumnIndex > -1 Then
            Dim index As Integer
            index = dgv1.CurrentRow.Index
            Dim sysid As String = dgv1.Rows(index).Cells("ColSysId").Value
            frmdetail.Sys_id = sysid
            frmdetail.ShowDialog()
            Me.btnSearch.PerformClick()
        End If
    End Sub

End Class